from django.db import models


class Message(models.Model):
    STATUS_CHOICES = (
        (0, '审核中'),
        (1, '审核通过'),
        (2, '审核不通过'),
    )

    name = models.CharField(max_length=100, verbose_name='留言者名')
    content = models.TextField(verbose_name='留言内容')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='留言时间')
    status = models.IntegerField(choices=STATUS_CHOICES, default=0, verbose_name='留言状态')

    class Meta:
        verbose_name = '留言'
        verbose_name_plural = '留言'

    def __str__(self):
        return f'{self.name} - {self.get_status_display()}'
